import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.net.Socket;
import java.util.Scanner;

public class Client {

	public static void main(String[] args) {
		// 201521123059
		try{
			Socket s=new Socket("127.0.0.1",8189);
			try{
				InputStream inStream = s.getInputStream();
				Scanner in=new Scanner(inStream);
				//201521123059
				PrintWriter out=new PrintWriter(s.getOutputStream());
				Scanner sc=new Scanner(System.in);
				String line1=sc.nextLine();
				out.println(line1);
				out.flush();
				
				while(in.hasNext())
				{
					String line=in.nextLine();
					System.out.println(line);
				}
			}finally{
				s.close();
			}
		}catch(IOException e){
			e.printStackTrace();
		}
		
	}

}
